// 网关对应的模块常量
export const ApiModulesRoutes = {
  BASE: '/base',
  USER: '/user',
  EXTERNAL: '/external',
  MESSAGE: '/message',
  IOT: '/iot',
}
// 2147483647
export const MAX_INTEGER = 2147483647

// 用于自适应
export const BASE_SCREEN_WIDTH = 1920
export const BASE_SCREEN_HEIGHT = 1080

export const AccessUrl = {
  manageUrl: process.env.VUE_APP_MANAGE_URL.replace(process.env.VUE_APP_PATH, window.location.hostname),
  frontUrl: process.env.VUE_APP_FRONT_URL.replace(process.env.VUE_APP_PATH, window.location.hostname),
  indexUrl: process.env.VUE_APP_INDEX_URL.replace(process.env.VUE_APP_PATH, window.location.hostname),
}

export const SYSTEM_STATIC = '/bdi-dt/system-static/'


export const MenuTypeEnum = {
  // PC前台
  FRONT: 'FRONT',
  // PC后台
  MANEGE: 'MANEGE',
  // 移动端
  MOBILE: 'MOBILE'
}

/**
 * url的环境区分
 * @param {String} devUrl dev环境的url
 * @param {String} prodUrl prod环境的url
 */
export function constUrlFormat(devUrl, prodUrl) {
  if (!prodUrl) return devUrl || ''
  return process.env.NODE_ENV === 'development' ? devUrl : prodUrl
}


export default {
  AccessUrl,
  BASE_SCREEN_WIDTH,
  BASE_SCREEN_HEIGHT,
  ApiModulesRoutes,
  SYSTEM_STATIC,
  MenuTypeEnum,
  MAX_INTEGER,
  constUrlFormat
}
